package indi.matcha.csmallproducttest.controller;

import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import indi.matcha.csmallproducttest.pojo.dto.PmsAttributeTemplateDTO;
import indi.matcha.csmallproducttest.service.PmsAttributeTemplateService;
import indi.matcha.csmallproducttest.web.JsonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * @program: csmall-product
 * @description:
 * @author: Mr.Tang
 * @create: 2023-03-23 19:40
 **/
@RestController
@RequestMapping("/PmsAttributeTemplates")
@Api(tags = "01.属性模板管理模块")
public class PmsAttributeTemplateController {
    @Autowired
    PmsAttributeTemplateService pmsAttributeTemplateService;

    // http://localhost:10086/PmsAttributeTemplates/add-new?name=TestName001&pinyin=TestDescription001&keywords=22&sort=199
    // kinfe4j  http://localhost:9080/doc.html
    @PostMapping("/add-new")
    @ApiOperation("添加属性模板")
    @ApiOperationSupport(order = 100)
    public JsonResult addNew(@Valid PmsAttributeTemplateDTO pmsAttributeTemplateDTO){
        pmsAttributeTemplateService.addNew(pmsAttributeTemplateDTO);
        return JsonResult.OK();
    }
}
